package org.mfoyou.agent.center.dao.inf;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.mfoyou.agent.common.dao.domain.HuawuServiceCoupon;
import org.mfoyou.agent.common.dao.domain.HuawuServiceCouponExample;

/**
 * 优惠券mapper
 *
 * @author wb-zh270168
 */
public interface HuawuServiceCouponMapper {

    int countByExample(HuawuServiceCouponExample example);

    int deleteByExample(HuawuServiceCouponExample example);

    int insert(HuawuServiceCoupon record);

    int insertSelective(HuawuServiceCoupon record);

    List<HuawuServiceCoupon> selectByExample(HuawuServiceCouponExample example);

    int updateByExampleSelective(@Param("record") HuawuServiceCoupon record, @Param("example") HuawuServiceCouponExample example);

    int updateByExample(@Param("record") HuawuServiceCoupon record, @Param("example") HuawuServiceCouponExample example);

    /**
     * 激活优惠券并设置有效期
     *
     * @param couponState
     * @param couponStartTime
     * @param couponEndTime
     * @param serviceCouponId
     * @return
     */
    int activationShareCouponByServiceCouponId(Integer couponState, Date couponStartTime, Date couponEndTime, Integer serviceCouponId);

    /**
     * 根据主键查询优惠券数据
     *
     * @param couponId 主键: 优惠券id
     * @return
     */
    HuawuServiceCoupon selectByPrimaryKey(Integer couponId);
}